//
//  MBOrderPayTableViewCell.m
//  MemberBusiness-ios
//
//  Created by 掌心 on 2018/6/1.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBOrderPayTableViewCell.h"

@implementation MBOrderPayTableViewCell

-(void)setupLayout
{
    [super setupLayout];
    
    UIImageView* goodsImageView = [[UIImageView alloc]init];
    goodsImageView.image = [UIImage imageFromColor:COLOR_BG forSize:CGSizeMake([UIView lf_sizeFromIphone6:90], [UIView lf_sizeFromIphone6:90]) withCornerRadius:[UIView lf_sizeFromIphone6:6]];
    [self.contentView addSubview:goodsImageView];
    
    [goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset([UIView lf_sizeFromIphone6:12]);
        make.size.mas_equalTo(CGSizeMake([UIView lf_sizeFromIphone6:90], [UIView lf_sizeFromIphone6:90]));
    }];
    
    UILabel* nameLabel = [[UILabel alloc]init];
    nameLabel.text = @"北欧客厅可移动沙发边几简约现代小圆桌简约现代小圆桌";
    nameLabel.numberOfLines = 0;
    nameLabel.font = [UIFont lf_systemFontOfSize:13];
    nameLabel.textColor = [UIColor colorWithR:45 G:45 B:45];
    [self.contentView addSubview:nameLabel];
    
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(goodsImageView).offset([UIView lf_sizeFromIphone6:4]);
        make.left.equalTo(goodsImageView.mas_right).offset([UIView lf_sizeFromIphone6:10]);
        make.right.equalTo(self.contentView).offset([UIView lf_sizeFromIphone6:-13]);
    }];
    
    UILabel* moneyLabel = [[UILabel alloc]init];
    moneyLabel.text = @"￥1250.00";
    moneyLabel.font = [UIFont lf_systemFontOfSize:15];
    moneyLabel.textColor = [UIColor colorWithR:237 G:85 B:89];
    [self.contentView addSubview:moneyLabel];
    
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(goodsImageView);
        make.left.equalTo(nameLabel);
    }];
}

+(NSNumber *)calculateRowHeightWithViewModel:(MBBaseTableCellViewModel *)viewModel
{
    return @(110);
}

@end
